home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / unarced / graphics / pbmplus / pbm / pbmmask.man < prev    next >
Text File  |  1995-03-17  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4.      pbmmask(1)           AMIGA (08 August 1989)            pbmmask(1)
  5.  
  6.  
  7.  
  8.      NAME
  9.           pbmmask - create a mask bitmap from a regular bitmap
  10.  
  11.      SYNOPSIS
  12.           pbmmask [-expand] [pbmfile]
  13.  
  14.      DESCRIPTION
  15.           Reads a portable bitmap as input.  Creates a corresponding
  16.           mask bitmap and writes it out.
  17.  
  18.           The color to be interpreted as "background" is determined
  19.           automatically.  Regardless of which color is background, the
  20.           mask will be white where the background is and black where
  21.           the figure is.
  22.  
  23.           This lets you do a masked paste like this, for objects with
  24.           a black background:
  25.               pbmmask obj > objmask
  26.               pnmpaste < dest -and objmask <x> <y> | pnmpaste -or obj <x> <y>
  27.           For objects with a white background, you can either invert
  28.           them or add a step:
  29.               pbmmask obj > objmask
  30.               pnminvert objmask | pnmpaste -and obj 0 0 > blackback
  31.               pnmpaste < dest -and objmask <x> <y> | pnmpaste -or blackback <x> <y>
  32.           Note that this three-step version works for objects with
  33.           black backgrounds too, if you don't care about the wasted
  34.           time.
  35.  
  36.           You can also use masks with graymaps and pixmaps, using the
  37.           pnmarith tool.  For instance:
  38.               ppmtopgm obj.ppm | pgmtopbm -threshold | pbmmask > objmask.pbm
  39.               pnmarith -multiply dest.ppm objmask.pbm > t1.ppm
  40.               pnminvert objmask.pbm | pnmarith -multiply obj.ppm - > t2.ppm
  41.               pnmarith -add t1.ppm t2.ppm
  42.           An interesting variation on this is to pipe the mask through
  43.           the pnmsmooth script before using it.  This makes the
  44.           boundary between the two images less sharp.
  45.  
  46.           -expand
  47.                Expands the mask by one pixel out from the image.  This
  48.                is useful if you want a little white border around your
  49.                image.  (A better solution might be to turn the pbmlife
  50.                tool into a general cellular automaton tool...)
  51.  
  52.      SEE ALSO
  53.           pnmpaste(1), pnminvert(1), pbm(5), pnmarith(1), pnmsmooth(1)
  54.  
  55.      AUTHOR
  56.           Copyright (C) 1988 by Jef Poskanzer.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                         (printed 10/19/91)
  64.  
  65.  
  66.  
  67.